// Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象分配到目标对象。它将返回目标对象。

// const target = {1: 'a', 2: 'b'};
// const source = {5: 'c', 6: 'd'};

// const total = Object.assign(target, source);
// console.log(target);
// console.log(total);

const target = {};
const source = {name: '张三', age: 18};
const object = Object.assign(target, source);
console.log(target);
console.log(object);